/**
 *
 */
var yueStore4wa_1 = Ext.create('Ext.data.Store', {
	storeId: 'yueSample4wa_1',
	fields:[ 'index1', 'index2', 'index3', 'index4', 'index5', 'index6', 'index7', 'index8', 'index9', 'index10',
		'index11', 'index12', 'index13', 'index14', 'index15', 'index16', 'index17', 'index18', 'index19', 'index20'],
	groupField: 'index1'
});

yueStore4wa_1.add([
	{index2: '流域1', index3: Math.random()*10, index4: Math.random()*10, index5: Math.random()*10},
	{index2: '流域2', index3: Math.random()*10, index4: Math.random()*10, index5: Math.random()*10},
	{index2: '流域3', index3: Math.random()*10, index4: Math.random()*10, index5: Math.random()*10},
	{index2: '流域4', index3: Math.random()*10, index4: Math.random()*10, index5: Math.random()*10}
]);

function yueFillDataWaterArea(data){
	yueStore4wa_1.setData(data);
}

Ext.define('Admin.view.needwater.subpage.waterArea',{
	extend:'Ext.panel.Panel',
	xtype:'yueWaterArea',
	//起别名
	alias:'yueWaterArea',
	require:[],
	user:[],
	userCLs:'big-100 small-100',
	layout: {
        type: 'hbox',
        align: 'stretch'
    },
	items: [{
		xtype: 'image',
		region: 'center',
    	src: 'resources/images/wateroptimum/fhwater.png',
    	height: 700,
    	flex:1
	},{
		xtype: 'grid',
		store: Ext.data.StoreManager.lookup('yueSample4wa_1'),
		border: true,
		flex: 1,
		margin: '0 0 0 20',
		columns: [
			{ text: '水资源区', dataIndex: 'index1', minWidth: 100, width:'31%', align: 'center' },
			{ text: '需水量(亿m³)', dataIndex: 'index3', minWidth: 100, width:'17%', align: 'center', renderer:
				function customRound(value, record){
					if(value == null)return null;
					return Ext.util.Format.round(value, 3);
				}
			},
			{ text: '供水量(亿m³)', dataIndex: 'index4', minWidth: 100, width:'17%', align: 'center', renderer:
					function customRound(value, record){
						if(value == null)return null;
						return Ext.util.Format.round(value, 3);
					}
			},
			{ text: '缺水量(亿m³)', dataIndex: 'index5', minWidth: 100, width:'17%', align: 'center', renderer:
					function customRound(value, record){
						if(value == null)return null;
						return Ext.util.Format.round(value, 3);
					}
			},
			{ text: '缺水率', dataIndex: 'index6', minWidth: 100, width:'17%', align: 'center', renderer:
					function customRound(value, record){
						if(value == null)return null;
						return Ext.util.Format.round(value, 3);
					}
			}
		]
	}]

});
